package be.novelfaces.component.util.element;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;

import be.novelfaces.component.util.attribute.InputAttributesWriterBuilder;

public class InputWriter extends
		ElementWriter<InputAttributesWriterBuilder> {

	private static class SingletonHolder {
		public static final InputWriter instance = new InputWriter();
	}

	public static InputWriter getInstance() {
		return SingletonHolder.instance;
	}

	private InputWriter() {
	}

	@Override
	public InputAttributesWriterBuilder getAttributesWriterBuilder(
			UIComponent component) {
		return new InputAttributesWriterBuilder(getFacesContext(),
				component, this);
	}

	@Override
	public String getElementName() {
		return ElementType.INPUT.getName();
	}

	private FacesContext getFacesContext() {
		return FacesContext.getCurrentInstance();
	}
}
